﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ytai.master" AutoEventWireup="true" CodeFile="Search.aspx.cs" Inherits="Search" %>
<%@ Register Assembly="SlimeeLibrary" Namespace="SlimeeLibrary" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div style="width: 875px; text-align:left; margin: 0 auto;">
	Search query: <asp:TextBox ID="txtSearch" runat="server" Width="600" /> <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="Search YouTube &gt;" /> <br />
	<asp:RadioButtonList runat="server" ID="rblSearchType" RepeatDirection="Horizontal" style="width: 50%; text-align:center;">
		<asp:ListItem Text="Search Query" Selected="True" Value="query" />
		<asp:ListItem Text="Username / Channel" Value="user" />
		<asp:ListItem Text="Categories" Value="category" />
	</asp:RadioButtonList><br /><br /><br />

	Advanced Search Options (all optional): <br /><br />

	<table>
		<tr>
			<td colspan="2" style="border-bottom: solid 1px black;">Upload Date</td>
			<td style="width: 25px;">&nbsp;</td>
			<td style="border-bottom: solid 1px black;">Options</td>
		</tr>
		<tr><td>Published after: </td><td>
			<cc1:DatePicker ID="dpStart" runat="server" AutoPostBack="true" Width="100px" PaneWidth="150px">
				<PaneTableStyle BorderColor="#707070" BorderWidth="1px" BorderStyle="Solid" />
				<PaneHeaderStyle BackColor="#0099FF" />
				<TitleStyle ForeColor="White" Font-Bold="true" />
				<NextPrevMonthStyle ForeColor="White" Font-Bold="true" />
				<NextPrevYearStyle ForeColor="#E0E0E0" Font-Bold="true" />
				<DayHeaderStyle BackColor="#E8E8E8" />
				<TodayStyle BackColor="#FFFFCC" ForeColor="#000000" Font-Underline="false" BorderColor="#FFCC99"/>
				<AlternateMonthStyle BackColor="#F0F0F0" ForeColor="#707070" Font-Underline="false"/>
				<MonthStyle BackColor="" ForeColor="#000000" Font-Underline="false"/>
			</cc1:DatePicker></td>
			<td></td>
			<td>
				<asp:RadioButtonList ID="rblCaption" runat="server">
					<asp:ListItem Text="Do not filter by caption" Value="" />
					<asp:ListItem Text="Videos with captions only" Value="true" />
					<asp:ListItem Text="Videos without captions only" Value="false" />
				</asp:RadioButtonList>
			</td>
		</tr>
		<tr><td>and/or before: </td>
		<td><cc1:DatePicker ID="dpStop" runat="server" AutoPostBack="true" Width="100px" PaneWidth="150px">
				<PaneTableStyle BorderColor="#707070" BorderWidth="1px" BorderStyle="Solid" />
				<PaneHeaderStyle BackColor="#0099FF" />
				<TitleStyle ForeColor="White" Font-Bold="true" />
				<NextPrevMonthStyle ForeColor="White" Font-Bold="true" />
				<NextPrevYearStyle ForeColor="#E0E0E0" Font-Bold="true" />
				<DayHeaderStyle BackColor="#E8E8E8" />
				<TodayStyle BackColor="#FFFFCC" ForeColor="#000000" Font-Underline="false" BorderColor="#FFCC99"/>
				<AlternateMonthStyle BackColor="#F0F0F0" ForeColor="#707070" Font-Underline="false"/>
				<MonthStyle BackColor="" ForeColor="#000000" Font-Underline="false"/>
		</cc1:DatePicker></td></tr>
	</table>
	<br /><br />

	<div style="margin: 0 auto; text-align:justify; width: 850px;">
		YouTube arbitrarily limits us to retrieving 1000 results for any search, and they don't provide a way to filter videos by date. Therefore, to filter by date, we must download the <b>entire list of search results</b>
		and filter the dates manually. Therefore, if you're looking at a query or user with over 1000 videos, being able to find their older videos will be pretty much hit-or-miss. Post a comment on 
		<a href="http://code.google.com/p/gdata-issues/issues/detail?id=624">this Google Code thread</a> if you want to help the fight to fix this feature! </div><br /><br />

	Maximum Results (Default 1000): <asp:TextBox ID="txtMaxResults" runat="server" MaxLength="4" Width="100" />
	<br /><br />

	Order by:
	<asp:DropDownList ID="ddlOrderby" runat="server">
			<asp:ListItem Text="Publish Date" Value="published" Selected="True" />
			<asp:ListItem Text="Relevance" Value="relevance" />
			<asp:ListItem Text="View Count" Value="viewCount" />
			<asp:ListItem Text="Rating" Value="rating" />
			<asp:ListItem Text="Alphabetical by Title" Value="title" />
			<asp:ListItem Text="Duration" Value="duration" />
			<asp:ListItem Text="Comments Count" Value="commentCount" />
			<asp:ListItem Text="Playlist Position" Value="position" />
		</asp:DropDownList>

	<br /><br /><br /><br />
	<asp:Button ID="btnSearch2" runat="server" OnClick="btnSearch_Click" Text="Search YouTube &gt;" />
	<hr />
	<div style="font-size: 6pt;">
	This page uses the <a href="http://www.codeproject.com/KB/webforms/datepicker.aspx">Slimee datepicker</a> control, because the ASP.NET Calendar control sucks. </div>
</div>
</asp:Content>

